package section3.Begin;
import java.io.*;
//<txt>有很多数字，找到最大的数
public class Maximum {
    public static void main(String[] args) {
        BufferedReader bf = null;
        String a = null;
        String b = null;
        try{
            InputStreamReader in = new InputStreamReader(new FileInputStream("D:\\Y2\\java\\作业\\java高级特性\\data.txt"), "GBK");
            bf = new BufferedReader(in);
            a=bf.readLine();
            int q=Integer.parseInt(a);
            while ((b = bf.readLine())!=null){
                int s = Integer.parseInt(b);
                if (s>q){
                    q=s;
                }
            }
            System.out.println("最大值是"+q);
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }finally {
            try {
                bf.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
}
